<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>marker</title>
		<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
		<!--加载样式表-->
		<link rel="stylesheet" href="demo-center.css"/>
		<!--加载地图js-->
		<script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.15&key=80dcce144694739ec6f22a2e9d0bfb0f"></script>
	</head>
	<body>
		
		
		<div class="mapBox">
			<!--地图容器-->
			<div id="container"></div>
		</div>
		
		
		<script>
			    var map = new AMap.Map("container", {
			        center: [116.400274, 39.905812],
			        zoom: 14
			    });
			
			    var path = [
			        [116.403322, 39.920255],
			        [116.410703, 39.897555],
			        [116.402292, 39.892353],
			        [116.389846, 39.891365]
			    ]
			
			    var polygon = new AMap.Polygon({
			        path: path,
			        strokeColor: "#FF33FF", 
			        strokeWeight: 6,
			        strokeOpacity: 0.2,
			        fillOpacity: 0.4,
			        fillColor: '#1791fc',
			        zIndex: 50,
			    })
			
			    map.add(polygon)
			    // 缩放地图到合适的视野级别
			    map.setFitView([ polygon ])
		</script>
		<style>
			.mapBox {
				width: 800px;
				height: 600px;
				position: relative;
			}
			html, body, #container {
				height: 100%;
				width: 100%;
			}
		</style>
	</body>
</html>
